package com.linjiahao.messagePush.util;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName MessageSendUtil
 * @Description: TODO
 * @Author linjiahao
 * @Date 2023/1/18
 **/

@Component
public class MessageSendUtil {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Value("${spring.rabbitmq.message-send.queue}")
    private String messageQueueName;

    public void nettySendMessage(Map<String,Object> map){
        rabbitTemplate.convertAndSend(messageQueueName,map);
    }
}
